import Car.Car;
import Factory.*;


public class Main {
    public static void main(String[] args) {
        try {
            IFactory factory;
            //反射机制
            Class classReflection =
                    Class.forName(Getclassname.ReadClassNameFromXML());
            Object objcetReflection = classReflection.getDeclaredConstructor().newInstance();

            factory = (IFactory) objcetReflection;
            Car car = factory.CreatCar();
            System.out.printf(car.getCarName());
        }catch (Exception e){
            System.out.println(e.toString());
        }
    }

}
